import { api } from "@/lib/api"; import { fmtInt } from "@/lib/format"; import { SOURCE_KIND_LABEL } from "@/lib/labels"; import { OG_CONTENT_TYPE, OG_SIZE, renderOg } from "@/lib/og-template"; export const alt = "Source — DataCenterIndex"; export const size = OG_SIZE; export const contentType = OG_CONTENT_TYPE; export const revalidate = 3600; export default async function Image({ params }: { params: Promise<{ id: string }> }) { const { id } = await params; const r = await api.source(id); if (!r.ok) return renderOg({ eyebrow: "Source", title: "Source registry", subtitle: "Every value in the index links back to the page it was observed on." }); const s = r.data; return renderOg({ eyebrow: "Source", title: s.name, subtitle: `${s.domain} · ${SOURCE_KIND_LABEL[s.kind]}${s.attribution ? ` · ${s.attribution}` : ""}`, stats: [ { label: "Documents", value: fmtInt(s.documents) }, { label: "Provenance rows", value: fmtInt(s.provenanceRows) }, { label: "Facilities", value: fmtInt(s.facilities) }, ], }); }